home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 5 / Apprentice-Release5.iso / Source Code / C / Games / Connect-4 v3.2 / c4.h < prev    next >
Encoding:
C/C++ Source or Header  |  1996-07-05  |  2.1 KB  |  51 lines  |  [TEXT/CWIE]

  1. /****************************************************************************/
  2. /**                                                                        **/
  3. /**                          Connect-4 Algorithm                           **/
  4. /**                                                                        **/
  5. /**                              Version 3.2                               **/
  6. /**                                                                        **/
  7. /**                            By Keith Pomakis                            **/
  8. /**                          (pomakis@pobox.com)                           **/
  9. /**                                                                        **/
  10. /**                               June, 1996                               **/
  11. /**                                                                        **/
  12. /****************************************************************************/
  13. /**                                                                        **/
  14. /**                  See the file "c4.c" for documentation.                **/
  15. /**                                                                        **/
  16. /****************************************************************************/
  17.  
  18. #ifndef C4_DEFINED
  19. #define C4_DEFINED
  20.  
  21. #ifndef Boolean
  22. #define Boolean unsigned char
  23. #endif
  24.  
  25. #ifndef TRUE
  26. #define TRUE 1
  27. #endif
  28.  
  29. #ifndef FALSE
  30. #define FALSE 0
  31. #endif
  32.  
  33. #define C4_NONE      2
  34. #define C4_MAX_LEVEL 16
  35.  
  36. /* See the file "c4.c" for documentation on the following functions. */
  37.  
  38. extern void    c4_poll(void (*poll_func)(void), int level);
  39. extern void    c4_new_game(int width, int height, int num);
  40. extern Boolean c4_make_move(int player, int column, int *row);
  41. extern Boolean c4_auto_move(int player, int level, int *column, int *row);
  42. extern char ** c4_board(void);
  43. extern int     c4_score_of_player(int player);
  44. extern Boolean c4_is_winner(int player);
  45. extern Boolean c4_is_tie(void);
  46. extern void    c4_win_coords(int *x1, int *y1, int *x2, int *y2);
  47. extern void    c4_end_game(void);
  48. extern void    c4_reset(void);
  49.  
  50. #endif /* C4_DEFINED */
  51.